-
Notifications
You must be signed in to change notification settings - Fork 18
Improve error handling when retrieving all detectors #267
Improve error handling when retrieving all detectors #267
Conversation
console.log( | ||
'Anomaly detector - Unable to retrieve detector state', | ||
err | ||
return Promise.reject( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer you log the err
. Same for below changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can add in more error logs. The way it is currently implemented, there will still be an error log when the thrown errors get caught in the outermost catch()
block of the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool. thanks for improving this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the fix!
Issue #, if available:
Description of changes:
This PR improves error handling in a few different places regarding retrieving all detectors from ES. Specifically:
could not retrieve property state from undefined
).Confirmed basic functionality of plugin works, and all UT/IT pass.
Screenshots:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.